<template>
	<section>
		<p class="delInputP">
			<input :placeholder="txt" v-model="pm.val" @focus="atFoucus" @blur="atBlur" />
			<img src="../../static/img/deletpwd.png" @click="del" v-if="pm.val&&isFocus" />
		</p>
	</section>
</template>

<script>
	//	import { homeGet } from '../common/comfn';
	//	import pull from '../common/pull.vue';
	export default {
		data() {
			return {
				isFocus: false
			}
		},
		props: ['pm', 'txt'],
		components: {},
		methods: {
			del: function() {
				this.pm.val = '';
				if(this.$el.childNodes[0].childNodes[0]) {
					this.$el.childNodes[0].childNodes[0].focus();
				}
			},
			atFoucus: function() {
				this.isFocus = true;
			},
			atBlur: function() {
				this.isFocus = false;
			}
		},
		created: function() {},
		mounted: function() {}
	}
</script>

<style scoped="scoped">
	.delInputP {
		position: relative;
		padding: 0.2rem 0;
	}
	
	.delInputP input {
		width: 80%;
		border: none;
	}
	
	.delInputP img {
		height: 0.16rem;
		position: absolute;
		right: 0;
	}
</style>